package com.jsong.linuo.recursion;

/**
 * @Author: 黎诺
 * @CreateTime: 2025-04-22
 * @Description: 递归练习1:求n!(n的阶层)
 */

public class Recursion01 {
    public static void main(String[] args) {
        int result = method(4);
        System.out.println("result = " + result);
    }

    public static int method(int n){
        if(n==1){
            return 1;
        }

        return n*method(n-1);
    }
}
